package com.blrs.VO;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class FlattenList {
    public static void main(String[] args) {
        List<List<Integer>> result = new ArrayList<>();
        result.add(Arrays.asList(1, 2, 3));
        result.add(Arrays.asList(4, 5, 6));
        result.add(Arrays.asList(7, 8, 9));

        List<Integer> flattenedList = result.stream()
                .flatMap(List::stream)
                .collect(Collectors.toList());

        System.out.println("Flattened List: " + flattenedList);
    }
}